package com.aspose.cells;

import java.util.ArrayList;

class zot {
   String a;
   Font b;
   int c;
   int d = 8;

   static ArrayList a(zbap var0, Font var1, Workbook var2) {
      String var3 = var0.c;
      byte[] var4 = var0.h();
      ArrayList var5 = new ArrayList();
      int var6 = -1;
      int var7 = -1;

      for(int var8 = 0; var8 < var4.length; var8 += 4) {
         int var9 = zase.a(var4, var8);
         int var10 = zase.a(var4, var8 + 2);
         if (var8 == 0 && var9 != 0) {
            if (var9 > var3.length()) {
               a(var5, var3, 0, var3.length() - 1, var10, var2);
               return var5;
            }

            a(var5, var3, 0, var9, var1, var2);
         }

         if (var6 != -1) {
            a(var5, var3, var6, var9, var7, var2);
         }

         var6 = var9;
         var7 = var10;
      }

      if (var6 != -1 && var6 < var3.length()) {
         a(var5, var3, var6, var3.length(), var7, var2);
      }

      return var5;
   }

   private static void a(ArrayList var0, String var1, int var2, int var3, Font var4, Workbook var5) {
      if (var3 >= var2) {
         zot var6 = new zot();
         var6.a = var1.substring(var2, var2 + (var3 - var2));
         var6.b = var4;
         com.aspose.cells.b.a.a.ze.a(var0, (Object)var6);
      }
   }

   private static void a(ArrayList var0, String var1, int var2, int var3, int var4, Workbook var5) {
      if (var2 <= var3) {
         if (var2 < var1.length()) {
            if (var3 > var1.length()) {
               var3 = var1.length();
            }

            zot var6 = new zot();
            var6.a = var1.substring(var2, var2 + (var3 - var2));
            if (var4 < 0) {
               var6.b = null;
            } else {
               if (var4 > 4) {
                  --var4;
               }

               if (var4 >= var5.getWorksheets().z().size()) {
                  var6.b = (Font)((Font)var5.getWorksheets().z().get(0));
               } else {
                  var6.b = (Font)((Font)var5.getWorksheets().z().get(var4));
               }
            }

            com.aspose.cells.b.a.a.ze.a(var0, (Object)var6);
         }
      }
   }
}
